import Vue from 'vue'
import Router from 'vue-router'
import travel  from '@/components/Discovery/travelstrategy'
import hotpoint  from '@/components/Discovery/hotcomments'
import landloard  from '@/components/Discovery/landloardstory'
import triptopi  from '@/components/Discovery/triptopic'
import userno  from '@/components/User/UserNoLogin'
import user  from '@/components/User/UserLogin'
Vue.use(Router)

const routes = [
  {
    path: '/',
    redirect: '/my/nologin'
  },
  {
    path: '/detail',
    name: 'detail',
    components: {
      content: () => import('@/components/Recommend/detail')
    }
  },
  {
    path: '/search',
    name: 'search',
    components: {
      content: () => import('@/components/Search')
    }
  },
   {
    path: '/seting',
    name: 'seting',
    components: {
      content: () => import('@/components/User/seting')
    }
  },
  {
    path: '/register',
    name: 'register',
    components: {
      content: () => import('@/components/User/register')
    }
  },
  {
    path: '/City',
    name: 'city',
    components: {
      content: () => import('@/components/city')
    }
  },
  {
    path: '/recommend',
    name: 'recommend',
    components: {
      content: () => import('@/components/Recommend/recommend'),
      footer: () => import('@/components/Footer')
    }
  },
  {
    path: '/invited',
    name: 'invited',
    components: {
      content: () => import('@/components/user_function/invited')
    }
  },
   {
    path: '/discount',
    name: 'discount',
    components: {
      content: () => import('@/components/user_function/discount')
    }
  },
  {
    path: '/mystory',
    name: 'mystory',
    components: {
      content: () => import('@/components/user_function/mystory')
    }
  },
  {
    path: '/address',
    name: 'address',
    components: {
      content: () => import('@/components/user_function/address')
    }
  },
  {
    path: '/collect',
    name: 'collect',
    components: {
      content: () => import('@/components/user_function/collect')
    }
  },
   {
    path: '/personalmessage',
    name: 'personalmessage',
    components: {
      content: () => import('@/components/user_function/personalMessage')
    }
  },
  {
    path: '/customerservice',
    name: 'customerservice',
    components: {
      content: () => import('@/components/user_function/customerservice')
    }
  },
  {
    path: '/landloard',
    name: 'landloard',
    components: {
      content: () => import('@/components/user_function/landloard')
    }
  },
  {
    path: '/mycustomer',
    name: 'mycustomer',
    components: {
      content: () => import('@/components/user_function/mycustomer')
    }
  },
  {
    path: '/feedback',
    name: 'feedback',
    components: {
      content: () => import('@/components/user_function/feedback')
    }
  },
  {
    path: '/invoice',
    name: 'invoice',
    components: {
      content: () => import('@/components/user_function/invoice')
    }
  },
  {
    path: '/sesame',
    name: 'sesame',
    components: {
      content: () => import('@/components/user_function/sesame')
    }
  },
  {
    path: '/VIP',
    name: 'VIP',
    components: {
      content: () => import('@/components/user_function/VIP')
    }
  },
  {
    path: '/shop',
    name: 'shop',
    components: {
      content: () => import('@/components/user_function/shop')
    }
  },
  {
    path: '/header',
    name: 'header',
    components: {
      content: () => import('@/components/header')
    }
  },
  {
    path: '/discover',
    name: 'discover',
    components: {
    	header: () => import('@/components/header'),
    	content: () => import('@/components/Discovery/Content'),
      footer: () => import('@/components/Footer')
    },
     children: [
     {
     	path: '',
      redirect:'travelstrategy'
     },
      {
        path: 'hotcomments',
        component: hotpoint
      },
      {
        path: 'landloardstory',
        component:landloard
      }, 
      {
        path: 'triptopic',
        component:triptopi
      },
       {
        path: 'travelstrategy',
        component:travel
      }
    ]
  },
  {
    path: '/order',
    name: 'order',
    components: {
      content: () => import('@/components/Indent/order'),
      footer: () => import('@/components/Footer')
    }
  },
  {
    path: '/ordering',
    name: 'ordering',
    components: {
     content: () => import('@/components/Indent/ordering'),
      footer: () => import('@/components/Footer')
    }
  },
  {
    path: '/orderd',
    name: 'orderd',
    components: {
      content: () => import('@/components/Indent/orderd'),
      footer: () => import('@/components/Footer')
    }
  },
    {
    path: '/officiallogin',
    name: 'officiallogin',
    components: {
      content: () => import('@/components/User/Login'),
    }
  },
  {
    path: '/my',
    name: 'my',
    components: {
      content: () => import('@/components/User/content'),
      footer: () => import('@/components/Footer')
    },
    children: [
    {
    	path:'',
    	redirect:'nologin'
    },
    {
        path: 'nologin',
        component:userno
    },
    {
        path: 'login',
        component:user
    }
   ]
  }
]
const router = new Router({
  routes: routes
})
export default router
